/**
 *
 * @description 异常捕获的状态拦截，请勿修改
 */

const errorLog = {
  state() {
    return {
      errorLogs: []
    }
  },
  getters: {
    errorLogs: (state) => state.errorLogs
  },
  mutations: {
    addErrorLog(state, errorLog) {
      state.errorLogs.push(errorLog)
    },
    clearErrorLog: (state) => {
      state.errorLogs.splice(0)
    }
  },
  actions: {
    addErrorLog({ commit }, errorLog) {
      commit('addErrorLog', errorLog)
    },
    clearErrorLog({ commit }) {
      commit('clearErrorLog')
    }
  }
}

export default {namespaced: true,...errorLog}
